<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8' />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <script type="text/javascript" src="__dotnar_lib_base_url__/js/lib/require.min.js"></script>
    <script type="text/javascript" src="__dotnar_lib_base_url__/js/lib/loader.js"></script>
    <script type="text/javascript" src="/js/require.config.js"></script>
    <script type="text/javascript">
    require(["core"], function(routie) {
        App.set("$Event.back", function() {
            history.back();
        });
        require(["WX", "coAjax", "queryString"], function(WX, coAjax, queryString) {
            window.removeLoader();
            // LS.globalGet("gaubee", function(v) {
            //     alert(v)
            // });
            globalGet("wx_pay_config", function(wx_pay_config) {
                var querystring = new queryString;
                wx_pay_config || (wx_pay_config = querystring.get("wx_pay_config"))
                if (!wx_pay_config) {
                    alert("error", "参数错误")
                    return
                }
                wx_pay_config = JSON.parse(wx_pay_config);
                wx_pay_config.success = function() {
                    alert("success", "支付成功");
                    var wx_pay_config = globalSet("wx_pay_config", "", function() {
                        App.get("$Event.back")();
                    });
                };
                WX(function(wx) {
                    wx.chooseWXPay(wx_pay_config);
                });
            });
        });
    });
    </script>
    <title>微信支付授权页</title>
</head>

<body>
    <div style="display:none" id="jSouperApp">
        <center>
            <button event-click="{{'$Event.back'}}">返回订单页</button>
        </center>
    </div>
</body>

</html>
